//
//  TTHttpTools.m
//  Village
//
//  Created by 程虎 on 2017/9/20.
//  Copyright © 2017年 程虎. All rights reserved.
//

#import "TTHttpTools.h"

@implementation TTHttpTools

+ (void)GetNewsWithPageNum:(NSInteger )pagenum WithCode:(NSString *)code Success:(void (^)(NSDictionary *valueDict))success failure:(void (^)(NSString *))failure
{
    NSMutableDictionary *bean = [NSMutableDictionary dictionary];
    NSMutableDictionary *dict = [NSMutableDictionary dictionary];
    [bean setValue:dict forKey:@"entitybean"];
    [dict setObject:@"5" forKey:@"pagesize"];
    [dict setObject:[NSString stringWithFormat:@"%ld",pagenum] forKey:@"pagenum"];
    [dict setObject:[Globle getInstance].account.areaid.length > 0 ? [Globle getInstance].account.areaid : ([Globle getInstance].areaid.length > 0 ? [Globle getInstance].areaid :@"") forKey:@"areaid"];
    [dict setObject:code forKey:@"code3"];
    [NetRequestClass Post:HeadlineNewsInfoURL Parameters:bean success:^(id result) {
        if (success) {
            success(result[@"data"]);
        }
    } failure:^(id valueCode, id error) {
        if (failure) {
            failure(error);
        }
    }];
}
@end
